|
|
 |
|
|
|
|
End If
Debug.Print "Validate"
End Sub |
|
|
|
 |
|
|
|
|
NOTE The Validate event will not fire if the user closes the form from the control menu. |
|
|
|
|
|
|
|
|
The CausesValidation Property |
|
|
|
|
|
|
|
|
The problem with the Validate event is that you might have a command button on your form thats used to enable the user to get help for the screen. If the user cant leave the field he or she is on because of the Validate event, then the help is not accessible. In this case, you need to set the CausesValidation property on the command button to a False value. When the user moves to this button, you can display the help, and the Validate event will not fire for the control. After the user has viewed the help and he or she tries to move to another control, the Validate event will fire on the control where the user came from. If the user moves directly back to the other control, the Validate event will not fire until he or she tries to move off the control normally. |
|
|
|
|
|
|
|
|
Lets now look at some tricks you can use with some of the standard controls. Some things are not readily apparent, and you need to be aware of them. |
|
|
|
|
|
|
|
|
Almost every control has a ToolTipText property. If you fill this in with some text, that text will appear when the user hovers the mouse over that control. This can be a great help to a user who does not really understand what type of input should go into a particular control. |
|
|
|
|
|
|
|
|
Finding a Value in a Combo Box |
|
|
|
|
|
|
|
|
Often youll have a combo box with a few hundred items in it. If you need to find a value very quickly, there are a few different techniques that you can use. In this chapter, youll learn two methods; in a later chapter, youll learn yet another method. |
|
|
|
|
|